#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings

class UploadedFile(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField()
    fs = FileSystemStorage(location=settings.DOWNLOAD_ROOT, base_url=settings.DOWNLOAD_URL)
    uploaded_file = models.FileField(upload_to='upload', storage=fs)
    is_public = models.BooleanField()
    
    def __unicode__(self):
        return self.name
